#ifndef _IOTHREAD_H_
#define _IOTHREAD_H_

#include "ioeventdef.h"


uvNameSpaceBegin



struct io_thread_t {
	io_event_loop*		eventloop;
	async_fun_cb		startfunction;
	async_fun_cb		runfunction;
	async_fun_cb		stopfunction;
	void*				data;
	int					status;
	void(*lockfunc)(io_thread_t* p);
	void(*unlockfunc)(io_thread_t* p);
	os_thread_t			threadhandler;
	os_thread_id		tid;
};


int	thread_init(io_thread_t* pThis, void* pdata, 
	async_fun_cb startcb, async_fun_cb runcb, async_fun_cb stopcb);
int	thread_start(io_thread_t* pThis);
int	thread_stop(io_thread_t* pThis);

uvNameSpaceEnd

#endif 